In digital cameras, autofocus may be used to focus on an object of interest. Such digital cameras may be provided as stand alone devices or they may be integrated into a multipurpose device such as a smartphone or the like. In various implementations, digital cameras may use phase detection autofocus (PDAF also referred to as phase autofocus or phase based autofocus), contrast based autofocus, or both. Phase detection autofocus separates left and right light rays though the camera's lens to sense left and right images. The left and right images are compared, and the difference in image positions on the camera sensors can be used to determine a shift of a camera lens for autofocus. Contrast autofocus measures the luminance contrast over a number of lens positions until a maximum contrast is reached. A difference in intensity between adjacent pixels of the camera's sensor naturally increases with correct image focus so that a maximum contrast indicates the correct focus. Phase detection autofocus may be advantageous in some implementations because it is typically faster than contrast based autofocus. For example, phase detection autofocus may allow a digital camera to determine the correct direction and amount of lens position movement based on a single frame of captured information, which may increase focusing speed. Furthermore, phase autofocus may be advantageous because it limits or eliminates overshoot (e.g., the camera changing lens position past the position of focus to obtain the information needed to determine the position of focus as performed in contrast based autofocus). Such overshoots take time and can reduce quality in video capture.
Calibration steps are conventionally required at the production line in order to handle variations between camera module samples during mass production to achieve sufficient autofocus accuracy with all samples. This includes detecting phase shifts between pairs of left and right sensor pixels. The phase shifts are then used to determine spatial characterization or conversion values to convert the phase shifts to lens offsets which are the distances a lens must move to correct for a measured phase shift and bring an object in a scene to be captured into focus. Phase detection autofocus calibration also may include a characterization of spatial shading of the left and right sensor pixels so that corrections in shading can be computed later during a run-time to capture images.
During calibration of phase shift mapping into lens offset, the mapping is set independently for each camera or sample to attain sufficient accuracy. Likewise, a flat field image is captured per sample, and correction gains are calculated for left and right type pixel values independently for each sample. Use of such PDAF calibration at the production line, however, where each sample is handled separately results in significant delay and costs. Also, inaccuracies and/or mistakes can occur when the per sample calibration data is captured and stored. Thus, the PDAF production line calibration actually may add an error source that is difficult and costly to debug.